load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "kvevent",
    srcs = [
        "alloc.go",
        "blocking_buffer.go",
        "chunked_event_queue.go",
        "event.go",
        "metrics.go",
        "throttling_buffer.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/ccl/changefeedccl/kvevent",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/ccl/changefeedccl/cdcutils",
        "//pkg/ccl/changefeedccl/changefeedbase",
        "//pkg/jobs/jobspb",
        "//pkg/kv/kvpb",
        "//pkg/roachpb",
        "//pkg/settings",
        "//pkg/util/hlc",
        "//pkg/util/log",
        "//pkg/util/log/logcrash",
        "//pkg/util/metric",
        "//pkg/util/mon",
        "//pkg/util/quotapool",
        "//pkg/util/syncutil",
        "//pkg/util/timeutil",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_cockroachdb_redact//:redact",
    ],
)

go_test(
    name = "kvevent_test",
    srcs = [
        "alloc_test.go",
        "bench_test.go",
        "blocking_buffer_test.go",
        "chunked_event_queue_test.go",
    ],
    embed = [":kvevent"],
    deps = [
        "//pkg/jobs/jobspb",
        "//pkg/keys",
        "//pkg/kv/kvpb",
        "//pkg/roachpb",
        "//pkg/settings/cluster",
        "//pkg/sql/randgen",
        "//pkg/sql/rowenc/keyside",
        "//pkg/sql/sem/tree",
        "//pkg/sql/types",
        "//pkg/testutils",
        "//pkg/util",
        "//pkg/util/ctxgroup",
        "//pkg/util/encoding",
        "//pkg/util/hlc",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/mon",
        "//pkg/util/quotapool",
        "//pkg/util/randutil",
        "//pkg/util/syncutil",
        "//pkg/util/timeutil",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_stretchr_testify//assert",
        "@com_github_stretchr_testify//require",
    ],
)
